Socket
Socket
Sign inDemoInstall

flatpickr

Package Overview
Dependencies
Maintainers
2
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatpickr

A lightweight, powerful javascript datetime picker


Version published
Weekly downloads
754K
decreased by-17.21%
Maintainers
2
Weekly downloads
 
Created

What is flatpickr?

Flatpickr is a lightweight and powerful datetime picker library. It allows users to easily select dates, times, or date ranges with a simple and customizable interface. It is highly configurable and supports a wide range of options and plugins to enhance its functionality.

What are flatpickr's main functionalities?

Basic Date Picker

This initializes a basic date picker on an input element with the ID 'datePicker'.

const flatpickr = require('flatpickr');
flatpickr('#datePicker', {});

Date Range Picker

This sets up a date range picker, allowing users to select a start and end date.

const flatpickr = require('flatpickr');
flatpickr('#dateRangePicker', { mode: 'range' });

Time Picker

This initializes a time picker without a calendar, allowing users to select a time.

const flatpickr = require('flatpickr');
flatpickr('#timePicker', { enableTime: true, noCalendar: true, dateFormat: 'H:i' });

Custom Date Format

This sets up a date picker with a custom date format (day-month-year).

const flatpickr = require('flatpickr');
flatpickr('#customFormatPicker', { dateFormat: 'd-m-Y' });

Disabling Specific Dates

This initializes a date picker that disables specific dates, preventing users from selecting them.

const flatpickr = require('flatpickr');
flatpickr('#disableDatesPicker', { disable: ['2023-10-10', '2023-10-20'] });

Other packages similar to flatpickr

Keywords

FAQs

Package last updated on 14 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc